/*
 * @Author: your name
 * @Date: 2022-03-31 12:31:55
 * @LastEditTime: 2023-04-10 11:48:48
 * @LastEditors: YNT 2501512800@qq.com
 * @Description: 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
 * @FilePath: \22-03-19 智慧社区\pages\webView\index.js
 */
import { getStorage } from '../../utils/storageSyncTool'
import Link from '../../api/link'
Page({
  /**
   * 页面的初始数据
   */
  data: {
    url: '',
  },

  /**
   * 生命周期函数--监听页面加载
   */
  onLoad: function (options) {
    let _that = this
    let url = ''
    switch (options.type) {
      case '0':
        url = 'https://mx.zjer.cn/courses'
        _that.setData({
          url,
        })
        break
      case '1':
        url = `https://jtt.tmuyun.com/zhejiang_jtt_hzyangan/#/home?code=testavator&state=SUCCESS`
        _that.setData({
          url,
        })
        break
      case '2':
        let { nick_name, phone } = getStorage('userInfo')
        Link.largeGetToken({
          phone: phone,
          username: nick_name,
        })
          .then(({ data }) => {
            let token = data.data
            url = `https://wx.wenyuan-env.com/mp/jdgfgj?token=${token}`
            _that.setData({
              url,
            })
          })
          .catch(({ errCode, data }) => {})
          .finally(wx.hideLoading())
        break
      case '3':
        url = 'https://c3fmc8aynun.720yun.com/t/c2vkc97w0rb'
        _that.setData({
          url,
        })
        break
      case '4':
        url =
          'https://w-1.betawm.com/prp/jpgdkx0rn9/Beta.LeadsH5/shop/index.html?uparms=03A0E1A7DB17D6A0F9F69877D17EEBD9799231D783596FB0E8A97CEFDAF23796FDB6AF4BBE1C15D85286222356AED0A1&fS=1&sTime=1650534738&fromModuleId=60013&SuiteId=wwcf072d5f896cdfb8&CorpId=wwcdeda45201c7a8d0&_dcsk=vq73p6xpkugguyc6gn5rgeimkxkickaaaaaaqaeqaiouovqeuaaaaaaabyx4frxgm3nofgnt62km5jkcdo3a&urTmpkey=7sxe62qnxzvyun2llrvhjjmynd'
        _that.setData({
          url,
        })
        break
      case '5':
        url =
          'https://agentdockingopac.lib.libsou.com/showhome/search/showSearch?schoolId=10836'
        _that.setData({
          url,
        })
        break
      case '6':
        url = 'https://ws.jdwasu.cn/wx-qljd/main?lv=S_Q_Z_C_&excuteId=87'
        _that.setData({
          url,
        })
        break
      case '7':
        let code = getStorage('userInfo').openid
        url = `https://jd-area-ddjy.juyizhilian.com/`
        _that.setData({
          url,
        })
        break
      case '8':
        url = 'https://hzgsapp3.hz571redcross.org.cn/Home.aspx?f=1&other=0'
        _that.setData({
          url,
        })
        break
      case '9':
        url = 'https://zhjt.jdjtzhzx.com/WeiXin/TravelService'
        _that.setData({
          url,
        })
        break
      case '10':
        url = 'https://jd-area-ddjy.juyizhilian.com/author'
        _that.setData({
          url,
        })
        break
      case '11':
        let openid = getStorage('userInfo').openid
        let phone1 = getStorage('userInfo').phone
        url = `https://wlsq.jst.zj.gov.cn/zzt/#/pages/indexXcx/indexXcx?fcbm=330100-0021&telephone=${phone1}&openid=${openid}`
        _that.setData({
          url,
        })
        break
        case '12':
          url = 'https://19dmfa61cur.720yun.com/vr/38d2dcf5cla'
          _that.setData({
            url,
          })
          break
        case '13':
          url = 'https://19dmfa61cur.720yun.com/vr/348259p894s'
          _that.setData({
            url,
          })
          break
        case '14':
          url = 'https://19dmfa61cur.720yun.com/vr/c4923cfgabg'
          _that.setData({
            url,
          })
          break
        case '15':
          url = 'https://19dmfa61cur.720yun.com/vr/96920cf59bv'
          _that.setData({
            url,
          })
          break
        case '16':
          url = 'https://19dmfa61cur.720yun.com/vr/a962ccf5yef'
          _that.setData({
            url,
          })
          break
        case '17':
          url = 'https://19dmfa61cur.720yun.com/vr/da62acf5ulv'
          _that.setData({
            url,
          })
          break
        case '18':
          url = 'https://19dmfa61cur.720yun.com/vr/f8120ca5u16'
          _that.setData({
            url,
          })
          break
        case '19':
          url = 'https://19dmfa61cur.720yun.com/vr/68523ca5ucf'
          _that.setData({
            url,
          })
          break
        case '20':
          url = 'https://19dmfa61cur.720yun.com/vr/d5329ca8w1f'
          _that.setData({
            url,
          })
          break
        case '21':
          url = 'https://19dmfa61cur.720yun.com/vr/24a29cf5xyv'
          _that.setData({
            url,
          })
          break
    }
  },

  /**
   * 生命周期函数--监听页面初次渲染完成
   */
  onReady: function () {},

  /**
   * 生命周期函数--监听页面显示
   */
  onShow: function () {},

  /**
   * 生命周期函数--监听页面隐藏
   */
  onHide: function () {},

  /**
   * 生命周期函数--监听页面卸载
   */
  onUnload: function () {},

  /**
   * 页面相关事件处理函数--监听用户下拉动作
   */
  onPullDownRefresh: function () {},

  /**
   * 页面上拉触底事件的处理函数
   */
  onReachBottom: function () {},

  /**
   * 用户点击右上角分享
   */
  onShareAppMessage: function () {},
})
